import React from 'react'
import { useLocation } from 'react-router-dom'
import qs from 'qs'

export default function Music() {
  const location = useLocation()
  // console.log(location.search);
  //location.search是字符串,把字符串转为对象
 const  {name,id} = qs.parse(location.search.split('?')[1])
//  console.log(num.name);
  return (
    <div>
      <h1>Music</h1>
      <p>用户名是:{name}编号是:{id}</p>
    </div>
  )
}
